// 执法机关主体信息 详情
<template>
  <div>
    <a-form-model :model="info_force_unit">
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="执法机关名称">
        <span v-text="info_force_unit.agy_name"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="执法机关类别">
        <span v-text="info_force_unit.agy_ct"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="执法机关层级">
        <span v-text="info_force_unit.agy_class"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="执法类别">
        <span v-text="info_force_unit.agy_type"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="编制人数">
        <span v-text="info_force_unit.org_num"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="是否公开">
        <span v-text="info_force_unit.public_is"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="是否直属">
        <span v-text="info_force_unit.directly"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="联系人姓名">
        <span v-text="info_force_unit.link_name"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="联系人电话">
        <span v-text="info_force_unit.link_phone"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="详细地址">
        <span v-text="info_force_unit.link_addr"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="所在部门id">
        <span v-text="info_force_unit.secid"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="所属区域">
        <span v-text="info_force_unit.bl_aera"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="设定依据">
        <span v-text="info_force_unit.rely"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="执法证编号范围">
        <span v-text="info_force_unit.force_sco"></span>
      </a-form-model-item>
      <a-form-model-item :label-col="labelCol" :wrapper-col="wrapperCol" label="监督证编号范围">
        <span v-text="info_force_unit.code_sco"></span>
      </a-form-model-item>
      <a-form-model-item>
        <div class="text-center">
          <a-button class="m-r-8" icon="close" @click="onClose">
            关闭
          </a-button>
        </div>
      </a-form-model-item>
    </a-form-model>
  </div>
</template>
<script>
  import { viewInfo_force_unit } from '@/api/info/info_force_unit'

  import Tp_agy_class from '@/enumeration/Tp_agy_class.js'
  import Tp_yesno from '@/enumeration/YesNo.js'
  import Tp_bl_aera from '@/enumeration/Tp_bl_aera.js'
  import { queryEnumerationValuesByName } from '@/api/base/enumeration'

  export default {
    data() {
      return {
        labelCol: { span: 6 }, // label宽
        wrapperCol: { span: 18 }, // 组件宽
        agy_ctList: {}, // 执法机关类别枚举下拉数据
        agy_classList: {}, // 执法机关层级枚举下拉数据
        Tp_agy_class: Tp_agy_class, // Tp_agy_class枚举值，用于状态判断或者参数传值
        public_isList: {}, // 是否公开枚举下拉数据
        Tp_yesno: Tp_yesno, // Tp_yesno枚举值，用于状态判断或者参数传值
        directlyList: {}, // 是否直属枚举下拉数据
        bl_aeraList: {}, // 所属区域枚举下拉数据
        Tp_bl_aera: Tp_bl_aera, // Tp_bl_aera枚举值，用于状态判断或者参数传值
        info_force_unit: {
          id: '',
          agy_name: '',
          agy_ct: '',
          agy_class: '',
          agy_type: '',
          org_num: '',
          public_is: '',
          directly: '',
          link_name: '',
          link_phone: '',
          link_addr: '',
          secid: '',
          bl_aera: '',
          rely: '',
          force_sco: '',
          code_sco: '',
        }, //执法机关主体信息信息
      }
    },
    created() {
      this.findEnumByName();
    },
    methods: {
      /**
       *  查询枚举值
       */
      findEnumByName() {
        const parameter = [
          { 'enname': 'agy_ct', 'enumName': '' },
          { 'enname': 'agy_class', 'enumName': 'Tp_agy_class' },
          { 'enname': 'public_is', 'enumName': 'Tp_yesno' },
          { 'enname': 'directly', 'enumName': 'Tp_yesno' },
          { 'enname': 'bl_aera', 'enumName': 'Tp_bl_aera' },
        ]
        parameter.forEach(item => {
          queryEnumerationValuesByName({ 'enName': item.enumName }).then(res => {
            console.log('query' + item.enumName, res.data)
            this[`${item.enname}List`] = res.data
            //this[`${item.enname}List`].unshift({ id: '', description: '全部' })
          })
        })
      },
      /**
       * 关闭页面
       */
      onClose() {
        this.$emit('close')
      },
      /**
       * 查询执法机关主体信息信息
       */
      findInfo_force_unitById(id) {
        viewInfo_force_unit(id).then(res => {
          this.info_force_unit = res.data
        })
      },
    }
  }
</script>
<style scoped>
</style>